Skip to content

[Bugfix][KV Offload] Revert "Return pending work, events and stats from on_schedule_end (#68962)" - #70063

Open
orozery wants to merge 2 commits into
vllm-project:mainfrom
orozery:revert-68962
Open

orozery wants to merge 2 commits into
vllm-project:mainfrom
orozery:revert-68962

Conversation

@orozery

@orozery orozery commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Reverts #68962 (item 4 of #68678). Restores same-step reporting of connector KV events and stats: the connector reads the manager's get_stats() and take_events() after update_connector_output() has applied the step's completions, instead of reading a snapshot taken in on_schedule_end() before the forward pass.

Claims

Validation

  • git revert 27053d0137005f5d5e55077314fa40d22b16d7fb applied cleanly on origin/main at 353d5febf7379b0459020c4341a9ffac58997650 (auto-merge on tests/v1/kv_connector/unit/offloading_connector/test_scheduler.py, no conflicts).
  • No residual StepResult, _ManagerStepState or _step_state references anywhere in vllm/ or tests/ (grep).
  • ast.parse clean on all 10 changed Python files; ruff check and ruff format --check pass.

Tests on an OpenShift cluster (1 GPU unless noted), torch 2.14.0+cu132, cuda_available True, at head d33e9b783219ec96df153bfd6383b78a7fc48961. The head has no CI image of its own (draft), so this is the ancestor image 353d5febf7379b0459020c4341a9ffac58997650 plus a Python overlay of the 4 changed vllm/ files and 6 tests/ files; every changed module loaded from the overlay (PYOV ok).

$ pytest tests/v1/kv_connector/unit/offloading_connector tests/v1/kv_offload
[HEAD]                    6 failed, 1813 passed, 6 skipped, 63 warnings in 1041.95s (0:17:21)

All 6 failures are test_dcp_partial_tail_*, and each fails while building ParallelConfig: Value error, World size (2) is larger than the number of available GPUs (1) in this node. The comparison run shows the same six ParallelConfig errors on unmodified code. Rerun of exactly those tests with 2 GPUs:

$ pytest tests/v1/kv_connector/unit/offloading_connector/test_scheduler.py -k dcp_partial_tail
[HEAD, 2 GPUs]            6 passed, 443 deselected, 35 warnings in 12.56s

Comparison (old-code): base image plus the reverted test files, to show the tests detect the interface change:

[NEW_TESTS_ON_OLD_CODE]  318 failed, 1501 passed, 6 skipped, 63 warnings in 1089.12s (0:18:09)

Top error: AttributeError: Mock object has no attribute 'get_stats' — the pre-#68962 tests drive get_stats(), take_events() and has_pending_work(), which the un-reverted code no longer calls.

Details

Why revert rather than wait for the follow-up. #68962 moved the step-end report into on_schedule_end(), which runs before the forward pass (vllm/v1/core/sched/scheduler.py:1482). Completions only reach the manager in update_connector_output() (:3893), and stats and events are read after it (:2766, :2799). So the snapshot is taken before the data it reports exists: events and stats from a finished transfer are reported one step later, and an idle engine needs one more step to flush them. The _stale marker added in #68962 bounds the delay but does not remove it.

Tradeoff. This gives back the batching #68962 introduced: up to four manager calls (and ~4 lock entries) per step instead of one, as reported in #68962's table. It is a short-term revert; item 4 is expected to re-land as the single batched complete_transfers(completions) -> StepResult call discussed on #68678, which reports the post-completion state in the same step and drains events and stats in the same update_from_output().

Coordination. #70021, #70047 and the #70048 draft are stacked on the StepResult interface this revert removes; they will need rebasing or reworking if this lands. The KVCR finish-time context issue raised on #68678 is independent of this revert and stays with those PRs.

Why this is not duplicating an existing PR. No open PR reverts #68962 (gh pr list --state open --search 68962, --search 'revert on_schedule_end'); the only hit is #60000, which merely references the commit.

AI assistance was used. The change was produced by Claude Code at the submitter's direction; the submitter reviewed the reverted diff and owns it.


Pull Request Checklist

🤖 Generated with Claude Code

…hedule_end (vllm-project#68962)"

This reverts commit 27053d0.

vllm-project#68962 moved the step-end report into on_schedule_end(), which runs before
the forward pass. Completions only reach the manager in
update_connector_output(), so events and stats produced by a finished
transfer are now reported one step later, and an idle engine takes one
extra step to flush them. Reverting restores same-step reporting:
get_stats() and take_events() are read after update_connector_output() and
therefore see the step's completions.

Item 4 of vllm-project#68678 is intended to re-land as a single batched
complete_transfers() call that returns the post-completion StepResult.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Or Ozeri <oro@il.ibm.com>
@mergify mergify Bot added kv-connector nixl NIXL KV connector / multi-tiered KV offloading (KVCR) labels Nov 26, 2026
@orozery
orozery marked this pull request as ready for review November 26, 2026 07:39

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@orozery orozery added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 26, 2026
@orozery

orozery commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #105918 for commit d1d7b1647b82.

ℹ️ This PR is 1 commit behind upstream main. Merged upstream main into this branch as d1d7b1647b82 before starting CI. Pull the branch before pushing more changes.

@orozery orozery changed the title Revert "[KV Offload] Return pending work, events and stats from on_schedule_end (#68962)" [Bugfix][KV Offload] Revert "Return pending work, events and stats from on_schedule_end (#68962)" Nov 26, 2026
@mergify mergify Bot added the bug Something isn't working label Nov 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working kv-connector nixl NIXL KV connector / multi-tiered KV offloading (KVCR) ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants